package com.cardone.platform.configuration.function;

import com.cardone.context.function.Execution1Function;
import com.cardone.platform.configuration.service.DictionaryService;
import com.google.common.collect.Lists;
import lombok.Setter;
import org.apache.commons.lang3.StringUtils;

import java.util.List;
import java.util.Map;

/**
 * Created by c100000002 on 15-1-12.
 */
public class FindDictionaryListByTypeCodesFunction implements Execution1Function<Map<String, List<Map<String, Object>>>, String> {
    @Override
    public Map<String, List<Map<String, Object>>> execution(String typeCodes) {
        return dictionaryService.findListMapByTypeCodeList(Lists.newArrayList(StringUtils.split(typeCodes, ",")));
    }

    @Setter
    private DictionaryService dictionaryService;
}
